Workloads in the Standard Library
You will notice a substantial difference between how we set the workloads for one of these gem5 systems as opposed to our original methods discussed in the basic configurations. Instead of manually entering or finding the binary path and specifying arguments, we can simply obtain the resource by calling obtain_resource(...)
. This is because we (I, Ayrton) configured (with a terrible amount of sweat and tears) a local gem5 resources for this course. You can take a closer look at the setup for this system in the 429-resources/local_resources
directory.
$429-resources/local_resources
.
├── 429bin/
│ └── ... (lots of binaries) ...
├── inputs/
│ └── ... (lots of files) ...
├── polybin/
│ └── ... (lots of binaries) ...
├── sources.pkl
├── polybench.pkl
└── resources.pkl
There are a few key elements here if you want to understand the setup involved:
- We have the binaries for the spec benchmarks in
429bin/
and polybench inpolybin/
- Inputs for all of the binaries (any files they need like mcf's lattices) in
inputs/
- Three configuration files
The configuration files are written in apple's PKL
language, and when you run the setup.sh
script, it will compile all of these files into the json format as specified by the gem5 documentation. The setup script will also set the variable $GEM5_CONFIG
, which will tell the simulator to look at sources.json
(built from sources.pkl
) for information corresponding to these workloads. The nice thing about this is that we not only have our local workloads available, but also the aggregated workloads of the entire gem5 community, which you can peruse at the gem5 resources webnsite.
In this setup, we now no longer have to worry a whole bunch about making sure all of our paths are correct for the binaries and the inputs and all the other stuff because someone else (me) has done it for you! You can try running the simulation in simple.py
and try to change the workload. If you want to check out all of the available workloads, you can run gem5.resources.downloader.list_resources()
(although this is currently broken in v24.1.0.1, you can checkout the generated json files and .pkl files to get more information).